/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sais.eswn.card;

import org.sais.eswn.tool.Tools;

/**
 *
 * @author Romulus
 */
public class CardText {

    private int type;
    private float cost = 0f;
    private String ruleText = "";

    public CardText(float cost, String ruleText) {
        this.cost = cost;
        this.ruleText = ruleText;
    }

    public String getDisplayText() {
        StringBuilder ret = new StringBuilder();
        switch (type) {
            case Card.CARDTYPE_SPELL:
                ret.append(Tools.getLoc(5) + cost + "\n\n");
                ret.append(ruleText + "\n");
                return ret.toString();
            case Card.CARDTYPE_HELP:
                ret.append(Tools.getLoc(17) + (int) cost + "\n\n");
                ret.append(ruleText + "\n");
                return ret.toString();
            case Card.CARDTYPE_CHARACTER:
                ret.append(ruleText + "\n");
                return ret.toString();
            default:
                return "";
        }
    }


    public String getExportText(int type) {
        return "";
        /*
        StringBuilder ret = new StringBuilder();
        switch (type) {
            case Card.CARDTYPE_SPELL:
                ret.append(Tools.getLoc(5) + cost + "\r\n");
                ret.append(ruleText + "\r\n");
                return ret.toString();
            case Card.CARDTYPE_HELP:
                ret.append(Tools.getLoc(17) + (int) cost + "\r\n");
                ret.append(effect + "\r\n");
                return ret.toString();
            default:
                return "";
        }
         * */
    }

    public float getCost() {
        return cost;
    }

    public String getRuleText() {
        return ruleText;
    }

    public static class CardTextBuilder {

        public float cost;
        public String ruleText = "";

        public CardText build() {
            return new CardText(cost, ruleText);
        }
    }
}
